{extend name="public/base" /}

{block name="title"}添加广告位{/block}

{block name="main"}
<div class="layui-tab" id="Js_title_navigation">
    <ul class="layui-tab-title">
        <li class="layui-this">添加广告位</li>
    </ul>
</div>
<form class="layui-form layui-row " action="" method="post">
	<div class="layui-col-xs12" style="padding-bottom: 50px;">
		<div class="layui-form-item layui-col-md4">
			<label class="layui-form-label">所属平台：</label>
			<div class="layui-input-block" >
                <input type="radio" name="plat" value="2" lay-filter="plat" title="平台广告位"  />
                <input type="radio" name="plat" value="3" lay-filter="plat" title="站点广告位" checked />
            </div>
		</div>
		<div class="layui-form-item layui-col-md4">
			<label class="layui-form-label">应用渠道：</label>
			<div class="layui-input-block">
                {volist name="channel" id="item"}
                <input type="radio" name="channel" value="{$key}" lay-filter="channel" title="{$item}"  />
                {/volist}
            </div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">标识：</label>
			<div class="layui-input-inline">
				<input type="text" name="tag" value="" placeholder="请输入唯一标识" lay-verify="required" class="layui-input" />
			</div>
            <div class="layui-form-mid layui-word-aux"><b>建议：</b>平台标识[plat/site]_渠道[web/wap/small]_页面_位置</div>
		</div>
		<div class="layui-form-item layui-col-md4">
			<label class="layui-form-label">名称：</label>
			<div class="layui-input-block">
				<input type="text" name="name" value="" placeholder="广告位名称" lay-verify="required" class="layui-input" />
			</div>
		</div>
        <div class="layui-form-item ">
			<label class="layui-form-label">图片尺寸：</label>
            <div class="layui-form-mid">宽 </div>
			<div class="layui-input-inline" style="width: 100px;">
				<input type="text" name="width" value="" placeholder="像素xp" lay-verify="number" class="layui-input" />
			</div>
             <div class="layui-form-mid">高 </div>
            <div class="layui-input-inline" style="width: 100px;">
                <input type="text" name="height" value="" placeholder="像素xp" lay-verify="number" class="layui-input" />
            </div>
            <div class="layui-form-mid layui-word-aux">广告上传时将按这个比例尺寸截图上传</div>
		</div>
        <div class="layui-form-item layui-col-md4">
			<label class="layui-form-label">展示页面：</label>
			<div class="layui-input-block">
				<input type="text" name="showpage" value="" placeholder="广告位展示页面url(不需要带域名)" class="layui-input" />
			</div>
		</div>
        <div class="layui-form-item layui-col-md4">
			<label class="layui-form-label">个数限制：</label>
			<div class="layui-input-block">
				<input type="text" name="limitnum" value="" placeholder="广告个数限制" lay-verify="number" class="layui-input" />
			</div>
            
		</div>
		<div class="layui-form-item layui-col-md4">
			<label class="layui-form-label">简介：</label>
			<div class="layui-input-block">
                <textarea name="des" placeholder="请输入广告位的备注或简介" class="layui-textarea"></textarea>
			</div>
		</div>
        
         
	</div>
    <div class="layui-layout-admin" >
        <div class="layui-footer" style="left:0;">
            <div class="layui-form-item">
                <a href="javascript:;" class="layui-btn layui-btn-primary" onclick="javascript:history.back();">返回</a>
				<button type="button" class="layui-btn" lay-submit="" lay-filter="addFrom">立即添加</button>
			</div>
        </div>
    </div>

</form>
{/block}
{block name="script"}
<script>
layui.use(['form','common'],function(){
    var form = layui.form;
    var common = layui.common;
    form.on('submit(addFrom)',function(data){
        if(typeof data.field.channel == 'undefined'){
            layer.msg("请选择广告位应用渠道",{icon:5});
            return false;
        }
        common.post('/set/adposition/add',data.field);
        return false;
    });
    
    form.render(); //更新全部
})
</script>
{/block}